<template>
  <div class="list-wrapper">
    <list class="list">
      <cell class="cell"
            v-for="(item, index) in longList"
            :key="index">
          <div class="panel"
               @click="select(index, item)"
               :class="[index === activeIndex ? 'active' : '']">
              <div class="left">
                  <p class="cont">
                      <text class="line"></text>
                      <text class="key">用户姓名:</text>
                      <text class="value">{{item.HZXM}}</text>
                  </p>
                  <p class="cont">
                      <text class="key">详细地址:</text>
                      <text class="value">{{item.XXDZ}}</text>
                  </p>
                  <p class="cont">
                      <text class="key">联系电话:</text>
                      <text class="value">{{item.LXDD}}</text>
                  </p>
                  <p class="cont">
                      <text class="key">安装状态:</text>
                      <text class="value handle">{{item.ZTBSName}}</text>
                  </p>
              </div>
              <div class="right">
                  <text class="icon">{{'\ue619'}}</text>
              </div>
          </div>
      </cell>
    </list>
  </div>
</template>
<script>
export default {
  name: 'list',
  data () {
    return {
      activeIndex: '-1',
      sbxq: {}
    }
  },
  methods: {
    select (index, item) {
      this.activeIndex = index,
      this.$router.open({
        name: 'installDetail',
        params: {
            dd_id: item.DD_ID
        }
      })
    }
  },
  computed: {
    longList () {
      return [this.$store.state.listData[0], this.$store.state.listData[1]]
    }
  }
}
</script>
<style scoped>
.list-wrapper{
  width: 750px;
  position: absolute;
  flex: 1;
}
.active{
  background-color: rgba(62,175,252,0.2);
}
.list{
    width: 750px;
    padding-left: 20px;
    padding-right: 20px;
}
.panel{
    width: 710px;
    background-color: #fff;
    padding: 20px;
    margin-top: 15px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}
.left{
    width: 600px;
}
.right{
    width: 70px;
    justify-content: center;
    align-items: center;
}
.icon{
    font-family: wxcIconFont;
    color: rgba(62,175,252,1);
    font-size: 50px;
}
.cont{
    width: 710px;
    flex-direction: row;
    padding-top: 10px;
    padding-left: 30px;
}
.line{
    display: block;
    width: 8px;
    height: 28px;
    background-color: rgba(62,175,252,1);
    margin-left: -25px;
    margin-right: 15px;
}
.key{
    padding-right: 15px;
    color:rgba(102,102,102,1);
    font-family:PingFangSC-Regular;
    font-size: 25px;
}
.value{
    font-family:PingFangSC-Regular;
    color:rgba(151,151,151,1);
    font-size: 25px;
}
.handle{
    width: 120px;
    height: 40px;
    border-color: rgba(62,175,252,1);
    border-style: solid;
    border-width: 2px;
    border-radius: 4px;
    text-align: center;
    line-height: 40px;
    color: rgba(62,175,252,1);
    font-family:PingFangSC-Regular;
}
</style>

